function IWLaunch(Path,Size,inputStr,otherStr,otherStr2)
{
	var w;
	var attribs;
	var argCount = IWLaunch.arguments.length;
	
	// i need to change this to an optional parameter list in the form of [optional,] etc.
	if (argCount > 2)
	{ 
		if (inputStr.length > 0)
		{
			Path = Path + '?in=' + inputStr;
		}
	}

	if (argCount > 3)
	{ 
		if (otherStr.length > 0)
		{
			Path = Path + '&o=' + otherStr;
		}
	}

	if (argCount > 4)
	{ 
		if (otherStr2.length > 0)
		{
			Path = Path + '&o2=' + otherStr2;
		}
	}

	if (Size == 'S')
	{
		attribs = "toolbar=no,scrollbars=yes,resizable,location=no,height=300,width=480";
	}
	else if (Size == 'M')
	{
		attribs = "toolbar=no,scrollbars=yes,resizable,location=no,height=400,width=640";
	}
	else if (Size == 'L')
	{
		attribs = "toolbar=no,scrollbars=yes,resizable,location=no,height=500,width=760";
	}
	else if (Size == 'L2')
	{
		attribs = "toolbar=no,scrollbars=yes,resizable,location=no,height=600,width=800";
	}
	else if (Size == 'XL')
	{
		attribs = "toolbar=no,scrollbars=yes,resizable,location=no,height=600,width=1024";
	}	
	else
	{
		attribs = "toolbar=no,scrollbars=yes,resizable,location=no,height=400,width=640";
	}

	w=window.open(Path,"InfoWindow",attribs);
}

function IWLaunchSized(Path,width,height)
{
    var attribs = "toolbar=no,scrollbars=yes,resizable,location=no,height=" + height + ",width=" + width;
    w=window.open(Path,"InfoWindow",attribs);
}
//defaults
var defaultMenuWidth='165px'; 
var defaultMenuBackgroundColor='white';  
var defaultDisappearDelay=250;
var defaultHideMenuOnClick="yes";
var disappear;
var dropX;
var dropY;
var height;
var width;

document.onmousemove=checkMouseXY;

document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+defaultMenuWidth+';background-color:'+defaultMenuBackgroundColor+';position:absolute;left:0px;top:0px;" onMouseover="clearhidemenu()"></div>')

function getposOffset(what, offsettype)
{
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null)
	{
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}


function showhide(obj, e, visible, hidden, defaultMenuWidth)
{
	dropmenuobj.style.left=dropmenuobj.style.top="-500px"
	if (defaultMenuWidth!="")
	{
		dropmenuobj.widthobj=dropmenuobj.style
		dropmenuobj.widthobj.width=defaultMenuWidth
	}
	
	if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
		obj.visibility=visible
	else if (e.type=="click")
		obj.visibility=hidden
}

function iecompattest()
{
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge)
{
	var edgeoffset=0
	if (whichedge=="rightedge")
	{
		var windowedge=!window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
		dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
		if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
			edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
	}
	else
	{
		var topedge=!window.opera? iecompattest().scrollTop : window.pageYOffset
		var windowedge=!window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
		dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
		if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
		{ //move up?
			edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
			if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
				edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
		}
	}
	return edgeoffset
}

function DhtmlDropDownMenu(obj, e, menucontents, defaultMenuWidth, xoffset, yoffset, disappearOnMouseOut)
{
    disappear=disappearOnMouseOut;
	if (!xoffset)
		xoffset=0
	if (!yoffset)
		yoffset=0
	if (window.event) 
		event.cancelBubble = true
	else if (e.stopPropagation) 
		e.stopPropagation()
		
	clearhidemenu()
	dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
	dropmenuobj.innerHTML = menucontents

	showhide(dropmenuobj.style, e, "visible", "hidden", defaultMenuWidth)
	dropmenuobj.x=getposOffset(obj, "left") + xoffset
	dropmenuobj.y=getposOffset(obj, "top") + yoffset
	dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
	dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
	
	dropX = dropmenuobj.x;
	dropY = dropmenuobj.y;
	height = dropmenuobj.clientHeight;
	width = defaultMenuWidth.replace(/[px]/gi, '');

if (defaultHideMenuOnClick=="yes"){
	document.onclick=hidemenu;
}

	return clickreturnvalue()
}

function checkMouseXY(e)
{
    if(disappear == "True") {
        getMouseXY(e);
        if(dropX) {
            if (mouseX < (dropX - 10) || mouseX > (parseInt(dropX,10) + parseInt(width,10) + 20))
            {
                hidemenu(e);
            }
            
            if (mouseY < dropY || mouseY > (parseInt(dropY,10) + parseInt(height,10) + 20)) {
                hidemenu(e);
            }
            
        }
    }
}

function getMouseXY(e) 
{
    ie = document.all?true:false
    if (ie) {
        mouseX = event.clientX + document.body.scrollLeft
        mouseY = event.clientY + document.body.scrollTop
    } else {
        mouseX = e.pageX
        mouseY = e.pageY
    }  
    // catch possible negative values
    if (mouseX < 0) {
        mouseX = 0
    }
    if (mouseY < 0) {
        mouseY = 0
    }
    return true;    
}

function clickreturnvalue()
{
	return false;
}

function contains_ns6(a, b) 
{
	while (b.parentNode)
		if ((b = b.parentNode) == a)
			return true;
	
	return false;
}

function dynamichide(e)
{
	delayhidemenu();
}

function hidemenu(e)
{
	if (typeof dropmenuobj!="undefined")
	{
		dropmenuobj.style.visibility="hidden"
	}
}

function delayhidemenu()
{
	delayhide=setTimeout("hidemenu()",defaultDisappearDelay)
}

function clearhidemenu()
{
	if (typeof delayhide != "undefined")
		clearTimeout(delayhide)
}

function popUp(string)
{
    alert(string);
}var fieldHelpTimeoutID;
var selectedFieldHelpID;

function preserveFieldHelp()
{
	if (fieldHelpTimeoutID)
	{
		window.clearTimeout(fieldHelpTimeoutID);
	}
	fieldHelpTimeoutID = null;
}

function hideFieldHelp(divID)
{
	selectedFieldHelpID = divID;
	fieldHelpTimeoutID = window.setTimeout('hideSpecificFieldHelp();', 200);
}

function hideSpecificFieldHelp(divID)
{
	var div = document.getElementById(selectedFieldHelpID);
	if (div)
	{
		div.style.display = 'none';
		selectedFieldHelpID = null;
	}
}

function showFieldHelp(divID, attachToObjectID, helpImageID)
{
//alert('in:'+divID+':'+helpImageID);
	divs = document.getElementsByTagName("div");
	
	for (i = 0; i < divs.length; i++)
	{
		var div = divs[i];
		if ('fieldHelp' == div.className)
		{
			if (divID == div.id)
			{
				if ('inline' == div.style.display)
				{
					div.style.display = 'none';
				}
				else
				{
					var top = 20;
					var left = 0;
					var maxWidth = 300;
					var widthAdjust = 0;
					var rightObject = document.getElementById(helpImageID);
					var leftObject = document.getElementById(attachToObjectID);
					var width;

					div.style.width = '300px';
					setRelativeLocation(leftObject, div, 0, leftObject.offsetHeight);
					div.style.display = 'inline';
				}
			}
			else
			{
				div.style.display = 'none';
			}
		}
	}
}

function setRelativeLocation(relativeToObject, element, offsetLeft, offsetTop)
{
	var newX = findPosX(relativeToObject);
    var newY = findPosY(relativeToObject);
    element.style.top = (newY + offsetTop) + 'px';
	element.style.left = (newX + offsetLeft) + 'px';
}
function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
        {
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
/*
   (c) copyright, Payscale.com 2005 onwards. All rights reserved. 
   Any use of this code except by Payscale.com is a copyright violation.
*/

/*
	AJAX MESSAGING CLASSES
*/

function ajax_timer(timeout, expression)
{
	this.timeout = timeout;
	this.expression = expression;
	this.started = false;
	
	this.start = ajax_timerStart;
	this.stop = ajax_timerStop;
}

function ajax_timerStart()
{
	if (!this.started)
	{
		this.timerID = window.setTimeout(this.expression, this.timeout);
		this.started = true;
	}
}

function ajax_timerStop()
{
	if (this.started)
	{
		window.clearTimeout(this.timerID);
		this.started = false;
	}
}

var ajax_statusUnitialized = 0;
var ajax_statusLoading = 1;
var ajax_statusLoaded = 2;
var ajax_statusInteractive = 3;
var ajax_statusComplete = 4;
var ajax_requestHeader = "ajaxRequest";
var ajax_errorNoXmlHttp = "NoXmlHttp";

function ajax_createXmlHTTP()
{
	if (window.ActiveXObject)
	{
		return new ActiveXObject("Microsoft.XmlHTTP");
	}
	if	(window.XMLHttpRequest)
	{
		return new XMLHttpRequest();
	}
	
	throw new Error("XmlHTTP unavailable");
}

// Workaround Firefox bugs
function ajax_getXmlHTTPRequestHeader(transport)
{
	var header = "";
	try
	{
		header = transport.getResponseHeader(ajax_requestHeader)
	}
	catch(e)
	{
	}
	
	return header;
}

// Global request table
var g_ajax = new ps_ajax();

function ps_ajax()
{
	this.requestTable = new Object(); 
	this.requestQueue = new Array();  	
	this.activeQueuedRequestCount = 0;
	this.internalIdentity = 0;
}

function ajax_requestNextID()
{
    return 'AJAX_ID_' + g_ajax.internalIdentity++;
}

function ajax_addRequest(request)
{
	g_ajax.requestTable[request.requestID] = request;
}

function ajax_getRequest(requestID)
{
	return g_ajax.requestTable[requestID];
}

function ajax_removeRequest(requestID)
{
	delete g_ajax.requestTable[requestID];
}

function ajax_request_callback(requestID, url, requestTimeout, retryInterval, callbackFunction)
{
    this.ajax_request(ajax_requestNextID(), url, requestTimeout, retryInterval);
    this.OnResponse = callbackFunction;
}

// An ajax request with default callback. 
function ajax_request(requestID, url, requestTimeout, retryInterval)
{	
	// Private Fields
	this.transport = null;
	this.responseHandler = function()
	{
		processAjaxResponse(requestID);
	};
	this.isQueued = false;
	
	// Public fields
	this.requestID = requestID;
	this.url = url;	
	this.postContent = null; // when !null, posts this content. Otherwise Get
	
	this.acceptRedirects = false;
	this.requestTimer = (requestTimeout > 0) ? ajax_createRequestTimer(requestTimeout, this) : null;
	this.retryTimer = (retryInterval > 0) ? ajax_createRetryTimer(retryInterval, this) : null;
	this.retryCount = (null != this.retryTimer) ? 1 : 0;
		
	// Events	
	this.onStart = null;
	this.onResponse = null;
	this.onResponseError = null;
	this.onRedirect = null;
	this.onStatus = null;
	this.onRequestTimeout = null;
	
	// Private Methods
	this.processReadyState = ajax_processReadyState;
	this.processError = ajax_processError;
	this.processEnd = ajax_endRequest;
	this.processTimeout = ajax_processTimeout;
	this.processRetryTimeout = ajax_processRetryTimeout;
	
	// Public methods
	this.send = ajax_beginRequest;
	this.queue = ajax_queueRequest;
	this.stop = ajax_requestClose;
    
}

function ajax_queueRequest()
{
	this.isQueued = true;
	g_ajax.requestQueue.push(this);	
	return ajax_beginQueuedRequest();
}

function ajax_requestClose()
{
	if (null != this.transport && this.transport.readyState != ajax_statusComplete)
	{
		this.transport.abort();
	}
	if (null != this.requestTimer)
	{
		this.requestTimer.stop();
	}
	if (null != this.retryTimer)
	{
		this.retryTimer.stop();
	}

	ajax_removeRequest(this.requestID);	
	if (this.isQueued)
	{
		ajax_removeQueuedRequest(this.requestID);
	}
}

function ajax_processReadyState()
{
	if (null != this.onStatus)
	{
		this.onStatus(this);
	}	
	
	if (ajax_statusComplete == this.transport.readyState)
	{
		this.processEnd();
	}
}

function ajax_beginRequest()
{
	if (null != ajax_getRequest(this.requestID))
	{
		// already active
		return false;
	}
	
	this.transport = null;
	this.transport = ajax_createXmlHTTP();
	this.transport.onreadystatechange = this.responseHandler;
	
	ajax_addRequest(this);	
	if (null != this.onStart)
	{
		this.onStart(this);
	}
	
	if (null != this.postContent)
	{
		this.transport.open("POST", this.url, true);
	}	
	else
	{
		this.transport.open("GET", this.url, true);
	}
	this.transport.setRequestHeader(ajax_requestHeader, this.url);
	this.transport.send(this.postContent);
	
	if (null != this.requestTimer)
	{
		this.requestTimer.start();
	}
	
	return true;
}

function ajax_endRequest()
{	
	try
	{
		this.stop();
		
		var responseText = this.transport.responseText;
		var status = this.transport.status;
		var ajaxResponse = new ajax_response(this, status, responseText);
		
		if ("" == responseText || status >= 400)
		{
			if (this.processError(ajaxResponse))
			{
				this.transport = null;
				return;
			}
		}			
		else if (ajax_getXmlHTTPRequestHeader(this.transport) != this.url && this.acceptRedirects)
		{
			if (null != this.onRedirect)
			{
				this.onRedirect(ajaxResponse);
			}
		}						
		else if (200 == status)
		{
			if (null != this.onResponse)
			{
				this.onResponse(ajaxResponse);
			}			
		}
		
		delete ajaxResponse;
		this.transport = null;
	}
	catch(e)
	{
		// Eat all async exceptions
	}

	if (this.isQueued)
	{
		g_ajax.activeQueuedRequestCount--;	
		ajax_beginQueuedRequest();
	}
}

function ajax_processError(ajaxResponse)
{
	if (null != this.onResponseError)
	{
		this.onResponseError(ajaxResponse);
	}			

	if (null != this.retryTimer && this.retryCount > 0)
	{
		ajax_addRequest(this);
		this.retryTimer.start();
		return true;
	}
	
	return false;
}

function ajax_processTimeout()
{
	if (null != this.transport && ajax_statusComplete == this.transport.readyState)
	{
		return;
	}	

	if (null != this.onRequestTimeout)
	{
		this.onRequestTimeout(this);
	}
	else
	{
		this.stop();
		this.processError(new ajax_response(ajaxRequest, 408, "Request Timed out. Please try again."));
	}
}

function ajax_processRetryTimeout()
{
	this.stop();	
	this.retryCount--;
	this.send();
}

function ajax_beginQueuedRequest()
{	
	if (g_ajax.requestQueue.length > 0 && 0 == g_ajax.activeQueuedRequestCount)
	{
		ajaxRequest = g_ajax.requestQueue.shift();
		g_ajax.activeQueuedRequestCount++;
		if (!ajaxRequest.send())
		{
			g_ajax.activeQueuedRequestCount--;
		}
		return true;
	}
	
	return false;
}

function ajax_removeQueuedRequest(requestID)
{
	var i;
	for (i = 0; i < g_ajax.requestQueue.length; ++i)
	{
		if (g_ajax.requestQueue[i].requestID == requestID)
		{
			g_ajax.requestQueue.splice(i, 1);
		}
	}	
}

function processAjaxResponse(requestID)
{
	var request = ajax_getRequest(requestID);
	if (null != request)
	{
		request.processReadyState();		
	}
}

// A response to an ajax request
function ajax_response(ajaxRequest, status, responseText)
{
	this.request = ajaxRequest;
	this.status = status;
	this.responseText = responseText;
}

function ajax_requestTimeoutCallback(requestID)
{
	var ajaxRequest = ajax_getRequest(requestID);
	if (null != ajaxRequest)
	{
		ajaxRequest.processTimeout();
	}	
}

// Great for loading parts using timers
function ajax_retryLoadTimerCallback(requestID)
{
	var ajaxRequest = ajax_getRequest(requestID);
	if (null != ajaxRequest)
	{
		ajaxRequest.processRetryTimeout();
	}
}

function ajax_createRequestTimer(timeout, ajaxRequest)
{
	return new ajax_timer(timeout, "ajax_requestTimeoutCallback(\"" + ajaxRequest.requestID + "\")");
}

function ajax_createRetryTimer(retryInterval, ajaxRequest)
{
	return new ajax_timer(retryInterval, "ajax_retryLoadTimerCallback(\"" + ajaxRequest.requestID + "\")");
}

/*
	AJAX DHTML HELPERS
*/

var ajax_dhtmlNodeState_Null = "";
var ajax_dhtmlNodeState_Loading = "loading";
var ajax_dhtmlNodeState_LoadError = "loadError";
var ajax_dhtmlNodeState_Loaded = "loaded";

function ajax_dhtmlOnResponse(ajaxResponse)
{
	var node = ajaxResponse.request.node;	
	node.loadState = ajax_dhtmlNodeState_Loaded;
	node.innerHTML = ajaxResponse.responseText;
}

function ajax_dhtmlOnError(ajaxResponse)
{
	var node = ajaxResponse.request.node;	

	node.loadState = ajax_dhtmlNodeState_LoadError;

	var ajaxRequest = ajaxResponse.request;
	errorMsg = "Error loading data.";
	if (null != ajaxRequest.retryTimer && ajaxRequest.retryCount > 0)
	{
		errorMsg = errorMsg + " Retrying in " + ajaxRequest.retryTimer.timeout/1000 + " seconds.";
	}
	else
	{
		errorMsg = errorMsg + " Please try again.";
	}
	node.innerHTML = errorMsg;
}

function ajax_dhtmlOnRedirect(ajaxResponse)
{
	ajaxResponse.request.node.loadState = ajax_dhtmlNodeState_LoadError;
	window.location.reload(true);
}

function ajax_dhtmlOnStart_Loading(ajaxRequest)
{
	ajaxRequest.node.loadState = ajax_dhtmlNodeState_Loading;
	return true;
}

function ajax_dhtmlShowLoadingImg(ajaxRequest)
{
	ajaxRequest.node.loadState = ajax_dhtmlNodeState_Loading;
	ajaxRequest.node.innerHTML = "<img SRC=\"/images/loading.gif\">";
	return true;
}

// If the given node isn't loaded, creates a request that you can use to load..
function ajax_dhtmlCreateGetPartRequest(node, url, retryInterval)
{
	if (null == url)
	{
		if ("" == (url = node.getAttribute("href")))
		{
			return null;
		}
	}	
	
	var request = new ajax_request(node.id, url, 1000, retryInterval);	
	node.loadState = ajax_dhtmlNodeState_Null;
	request.node = node;
	request.onStart = ajax_dhtmlOnStart_Loading;
	// We use the request timeout functionality to set our downloading image...
	// If we took more than 1 second, we'll show the downloading gif
	request.onRequestTimeout = ajax_dhtmlShowLoadingImg;
	request.onResponse = ajax_dhtmlOnResponse;
	request.onResponseError = ajax_dhtmlOnError;
	request.onRedirect = ajax_dhtmlOnRedirect;

	return request;
}

function ajax_dhtmlGetPartLoadState(node)
{
	var state = node.loadState;
	return (null != state) ? state : ajax_dhtmlNodeState_Null;
}

function ajax_dhtmlIsPartLoaded(node)
{
	return (ajax_dhtmlNodeState_Loaded == ajax_dhtmlGetPartLoadState(node));
}

function ajax_submitCallbackRequest(url, retryInterval, requestTimeout, callbackFunction, errorFunction, timeoutFunction)
{
    var id = ajax_requestNextID();
	var request = new ajax_request(id, url, requestTimeout, retryInterval);	
	request.onRequestTimeout = timeoutFunction;
	request.onResponse = callbackFunction;
	request.onResponseError = errorFunction;
	request.queue();
	return request;


}


function ajax_dhtmlEnsurePartLoaded(node, url, retryInterval)
{
	if (null == node)
	{
		return;
	}
	
	var requestID = node.id;	
	if (ajax_dhtmlNodeState_Null != ajax_dhtmlGetPartLoadState(node) || null != ajax_getRequest(requestID))
	{
		// Already in progress or already loaded	
		return;	
	}
	
	var request = ajax_dhtmlCreateGetPartRequest(node, url, retryInterval);
	if (null != request && !request.queue())
	{
		// We had to queue the request. Immediately show the waiting icon
		ajax_dhtmlShowLoadingImg(request);
	}
}

function setItemDisplay(item, displayStyle)
{
	if (null != item)
	{
		item.style.display= displayStyle;
	}
}
